Skip to content

Commit fc2d62d

Browse files
committed
Fix API changes of Chrome58
1 parent 453cb2c commit fc2d62d

28 files changed

+73
-105
lines changed

atom/app/atom_content_client.cc

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ content::PepperPluginInfo CreateWidevineCdmInfo(const base::FilePath& path,
9393
std::vector<std::string> codecs;
9494
codecs.push_back(kCdmSupportedCodecVp8);
9595
codecs.push_back(kCdmSupportedCodecVp9);
96-
#if defined(USE_PROPRIETARY_CODECS)
96+
#if BUILDFLAG(USE_PROPRIETARY_CODECS)
9797
codecs.push_back(kCdmSupportedCodecAvc1);
98-
#endif // defined(USE_PROPRIETARY_CODECS)
98+
#endif // BUILDFLAG(USE_PROPRIETARY_CODECS)
9999
std::string codec_string = base::JoinString(
100100
codecs, std::string(1, kCdmSupportedCodecsValueDelimiter));
101101
widevine_cdm_mime_type.additional_param_names.push_back(
@@ -198,11 +198,19 @@ base::string16 AtomContentClient::GetLocalizedString(int message_id) const {
198198
return l10n_util::GetStringUTF16(message_id);
199199
}
200200

201-
void AtomContentClient::AddAdditionalSchemes(
202-
std::vector<url::SchemeWithType>* standard_schemes,
203-
std::vector<url::SchemeWithType>* referrer_schemes,
204-
std::vector<std::string>* savable_schemes) {
205-
standard_schemes->push_back({"chrome-extension", url::SCHEME_WITHOUT_PORT});
201+
void AtomContentClient::AddAdditionalSchemes(Schemes* schemes) {
202+
schemes->standard_schemes.push_back("chrome-extension");
203+
204+
std::vector<std::string> splited;
205+
ConvertStringWithSeparatorToVector(&splited, ",",
206+
switches::kRegisterServiceWorkerSchemes);
207+
for (const std::string& scheme : splited)
208+
schemes->service_worker_schemes.push_back(scheme);
209+
schemes->service_worker_schemes.push_back(url::kFileScheme);
210+
211+
ConvertStringWithSeparatorToVector(&splited, ",", switches::kSecureSchemes);
212+
for (const std::string& scheme : splited)
213+
schemes->secure_schemes.push_back(scheme);
206214
}
207215

208216
void AtomContentClient::AddPepperPlugins(
@@ -214,25 +222,4 @@ void AtomContentClient::AddPepperPlugins(
214222
ComputeBuiltInPlugins(plugins);
215223
}
216224

217-
void AtomContentClient::AddServiceWorkerSchemes(
218-
std::set<std::string>* service_worker_schemes) {
219-
std::vector<std::string> schemes;
220-
ConvertStringWithSeparatorToVector(&schemes, ",",
221-
switches::kRegisterServiceWorkerSchemes);
222-
for (const std::string& scheme : schemes)
223-
service_worker_schemes->insert(scheme);
224-
225-
service_worker_schemes->insert(url::kFileScheme);
226-
}
227-
228-
void AtomContentClient::AddSecureSchemesAndOrigins(
229-
std::set<std::string>* secure_schemes,
230-
std::set<GURL>* secure_origins) {
231-
std::vector<std::string> schemes;
232-
ConvertStringWithSeparatorToVector(&schemes, ",", switches::kSecureSchemes);
233-
for (const std::string& scheme : schemes)
234-
secure_schemes->insert(scheme);
235-
}
236-
237-
238225
} // namespace atom

atom/app/atom_content_client.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,9 @@ class AtomContentClient : public brightray::ContentClient {
2323
std::string GetProduct() const override;
2424
std::string GetUserAgent() const override;
2525
base::string16 GetLocalizedString(int message_id) const override;
26-
void AddAdditionalSchemes(
27-
std::vector<url::SchemeWithType>* standard_schemes,
28-
std::vector<url::SchemeWithType>* referrer_schemes,
29-
std::vector<std::string>* savable_schemes) override;
26+
void AddAdditionalSchemes(Schemes* schemes) override;
3027
void AddPepperPlugins(
3128
std::vector<content::PepperPluginInfo>* plugins) override;
32-
void AddServiceWorkerSchemes(
33-
std::set<std::string>* service_worker_schemes) override;
34-
void AddSecureSchemesAndOrigins(
35-
std::set<std::string>* secure_schemes,
36-
std::set<GURL>* secure_origins) override;
3729

3830
private:
3931
DISALLOW_COPY_AND_ASSIGN(AtomContentClient);

atom/browser/api/atom_api_cookies.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ void SetCookieOnIO(scoped_refptr<net::URLRequestContextGetter> getter,
228228
GetCookieStore(getter)->SetCookieWithDetailsAsync(
229229
GURL(url), name, value, domain, path, creation_time,
230230
expiration_time, last_access_time, secure, http_only,
231-
net::CookieSameSite::DEFAULT_MODE, false,
232-
net::COOKIE_PRIORITY_DEFAULT, base::Bind(OnSetCookie, callback));
231+
net::CookieSameSite::DEFAULT_MODE, net::COOKIE_PRIORITY_DEFAULT,
232+
base::Bind(OnSetCookie, callback));
233233
}
234234

235235
} // namespace

atom/browser/api/atom_api_debugger.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ void Debugger::DispatchProtocolMessage(DevToolsAgentHost* agent_host,
4646
DCHECK(agent_host == agent_host_.get());
4747

4848
std::unique_ptr<base::Value> parsed_message(base::JSONReader::Read(message));
49-
if (!parsed_message->IsType(base::Value::TYPE_DICTIONARY))
49+
if (!parsed_message->IsType(base::Value::Type::DICTIONARY))
5050
return;
5151

5252
base::DictionaryValue* dict =

atom/browser/api/atom_api_desktop_capturer.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
#include "atom/browser/api/atom_api_desktop_capturer.h"
66

7+
using base::PlatformThreadRef;
8+
79
#include "atom/common/api/atom_api_native_image.h"
810
#include "atom/common/native_mate_converters/gfx_converter.h"
911
#include "base/strings/utf_string_conversions.h"

atom/browser/api/atom_api_session.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,8 @@ void DownloadIdCallback(content::DownloadManager* download_manager,
432432
last_modified, offset, length, std::string(),
433433
content::DownloadItem::INTERRUPTED,
434434
content::DownloadDangerType::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
435-
content::DOWNLOAD_INTERRUPT_REASON_NETWORK_TIMEOUT, false);
435+
content::DOWNLOAD_INTERRUPT_REASON_NETWORK_TIMEOUT, false,
436+
std::vector<content::DownloadItem::ReceivedSlice>());
436437
}
437438

438439
} // namespace

atom/browser/atom_browser_client.cc

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -296,27 +296,26 @@ void AtomBrowserClient::ResourceDispatcherHostCreated() {
296296
}
297297

298298
bool AtomBrowserClient::CanCreateWindow(
299+
int opener_render_process_id,
300+
int opener_render_frame_id,
299301
const GURL& opener_url,
300302
const GURL& opener_top_level_frame_url,
301303
const GURL& source_origin,
302-
WindowContainerType container_type,
304+
content::mojom::WindowContainerType container_type,
303305
const GURL& target_url,
304306
const content::Referrer& referrer,
305307
const std::string& frame_name,
306308
WindowOpenDisposition disposition,
307-
const blink::WebWindowFeatures& features,
309+
const blink::mojom::WindowFeatures& features,
308310
const std::vector<std::string>& additional_features,
309311
const scoped_refptr<content::ResourceRequestBodyImpl>& body,
310312
bool user_gesture,
311313
bool opener_suppressed,
312314
content::ResourceContext* context,
313-
int render_process_id,
314-
int opener_render_view_id,
315-
int opener_render_frame_id,
316315
bool* no_javascript_access) {
317316
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
318317

319-
if (IsRendererSandboxed(render_process_id)) {
318+
if (IsRendererSandboxed(opener_render_process_id)) {
320319
*no_javascript_access = false;
321320
return true;
322321
}
@@ -330,7 +329,7 @@ bool AtomBrowserClient::CanCreateWindow(
330329
disposition,
331330
additional_features,
332331
body,
333-
render_process_id,
332+
opener_render_process_id,
334333
opener_render_frame_id));
335334
}
336335

atom/browser/atom_browser_client.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,23 +80,22 @@ class AtomBrowserClient : public brightray::BrowserClient,
8080
std::unique_ptr<content::ClientCertificateDelegate> delegate) override;
8181
void ResourceDispatcherHostCreated() override;
8282
bool CanCreateWindow(
83+
int opener_render_process_id,
84+
int opener_render_frame_id,
8385
const GURL& opener_url,
8486
const GURL& opener_top_level_frame_url,
8587
const GURL& source_origin,
86-
WindowContainerType container_type,
88+
content::mojom::WindowContainerType container_type,
8789
const GURL& target_url,
8890
const content::Referrer& referrer,
8991
const std::string& frame_name,
9092
WindowOpenDisposition disposition,
91-
const blink::WebWindowFeatures& features,
93+
const blink::mojom::WindowFeatures& features,
9294
const std::vector<std::string>& additional_features,
9395
const scoped_refptr<content::ResourceRequestBodyImpl>& body,
9496
bool user_gesture,
9597
bool opener_suppressed,
9698
content::ResourceContext* context,
97-
int render_process_id,
98-
int opener_render_view_id,
99-
int opener_render_frame_id,
10099
bool* no_javascript_access) override;
101100
void GetAdditionalAllowedSchemesForFileSystem(
102101
std::vector<std::string>* schemes) override;

atom/browser/atom_javascript_dialog_manager.cc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,27 @@
1313
#include "base/strings/utf_string_conversions.h"
1414
#include "ui/gfx/image/image_skia.h"
1515

16-
using content::JavaScriptMessageType;
16+
using content::JavaScriptDialogType;
1717

1818
namespace atom {
1919

2020
void AtomJavaScriptDialogManager::RunJavaScriptDialog(
2121
content::WebContents* web_contents,
2222
const GURL& origin_url,
23-
JavaScriptMessageType message_type,
23+
JavaScriptDialogType dialog_type,
2424
const base::string16& message_text,
2525
const base::string16& default_prompt_text,
2626
const DialogClosedCallback& callback,
2727
bool* did_suppress_message) {
2828

29-
if (message_type != JavaScriptMessageType::JAVASCRIPT_MESSAGE_TYPE_ALERT &&
30-
message_type != JavaScriptMessageType::JAVASCRIPT_MESSAGE_TYPE_CONFIRM) {
29+
if (dialog_type != JavaScriptDialogType::JAVASCRIPT_DIALOG_TYPE_ALERT &&
30+
dialog_type != JavaScriptDialogType::JAVASCRIPT_DIALOG_TYPE_CONFIRM) {
3131
callback.Run(false, base::string16());
3232
return;
3333
}
3434

3535
std::vector<std::string> buttons = {"OK"};
36-
if (message_type == JavaScriptMessageType::JAVASCRIPT_MESSAGE_TYPE_CONFIRM) {
36+
if (dialog_type == JavaScriptDialogType::JAVASCRIPT_DIALOG_TYPE_CONFIRM) {
3737
buttons.push_back("Cancel");
3838
}
3939

@@ -55,7 +55,6 @@ void AtomJavaScriptDialogManager::RunBeforeUnloadDialog(
5555

5656
void AtomJavaScriptDialogManager::CancelDialogs(
5757
content::WebContents* web_contents,
58-
bool suppress_callbacks,
5958
bool reset_state) {
6059
}
6160

atom/browser/atom_javascript_dialog_manager.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class AtomJavaScriptDialogManager : public content::JavaScriptDialogManager {
1717
void RunJavaScriptDialog(
1818
content::WebContents* web_contents,
1919
const GURL& origin_url,
20-
content::JavaScriptMessageType javascript_message_type,
20+
content::JavaScriptDialogType dialog_type,
2121
const base::string16& message_text,
2222
const base::string16& default_prompt_text,
2323
const DialogClosedCallback& callback,
@@ -27,7 +27,6 @@ class AtomJavaScriptDialogManager : public content::JavaScriptDialogManager {
2727
bool is_reload,
2828
const DialogClosedCallback& callback) override;
2929
void CancelDialogs(content::WebContents* web_contents,
30-
bool suppress_callbacks,
3130
bool reset_state) override;
3231

3332
private:

0 commit comments

Comments
 (0)