Fix compilation errors caused by Chrome 39

This commit is contained in:
Cheng Zhao 2014-12-07 07:43:26 -08:00
parent 25ea169c72
commit 10823eeeaa
8 changed files with 40 additions and 66 deletions

View file

@ -69,14 +69,17 @@ void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused,
dict.SetMethod("startRecording", base::Bind( dict.SetMethod("startRecording", base::Bind(
&TracingController::EnableRecording, base::Unretained(controller))); &TracingController::EnableRecording, base::Unretained(controller)));
dict.SetMethod("stopRecording", base::Bind( dict.SetMethod("stopRecording", base::Bind(
&TracingController::DisableRecording, base::Unretained(controller))); &TracingController::DisableRecording,
base::Unretained(controller),
nullptr));
dict.SetMethod("startMonitoring", base::Bind( dict.SetMethod("startMonitoring", base::Bind(
&TracingController::EnableMonitoring, base::Unretained(controller))); &TracingController::EnableMonitoring, base::Unretained(controller)));
dict.SetMethod("stopMonitoring", base::Bind( dict.SetMethod("stopMonitoring", base::Bind(
&TracingController::DisableMonitoring, base::Unretained(controller))); &TracingController::DisableMonitoring, base::Unretained(controller)));
dict.SetMethod("captureMonitoringSnapshot", base::Bind( dict.SetMethod("captureMonitoringSnapshot", base::Bind(
&TracingController::CaptureMonitoringSnapshot, &TracingController::CaptureMonitoringSnapshot,
base::Unretained(controller))); base::Unretained(controller),
nullptr));
dict.SetMethod("getTraceBufferPercentFull", base::Bind( dict.SetMethod("getTraceBufferPercentFull", base::Bind(
&TracingController::GetTraceBufferPercentFull, &TracingController::GetTraceBufferPercentFull,
base::Unretained(controller))); base::Unretained(controller)));

View file

@ -225,28 +225,12 @@ void WebContents::WebContentsDestroyed() {
Emit("destroyed"); Emit("destroyed");
} }
void WebContents::WillAttach(content::WebContents* embedder_web_contents, void WebContents::DidAttach(int guest_proxy_routing_id) {
const base::DictionaryValue& extra_params) {
embedder_web_contents_ = embedder_web_contents;
extra_params_.reset(extra_params.DeepCopy());
}
content::WebContents* WebContents::CreateNewGuestWindow(
const content::WebContents::CreateParams& create_params) {
NOTREACHED() << "Should not create new window from guest";
return nullptr;
}
void WebContents::DidAttach() {
base::ListValue args; base::ListValue args;
args.Append(extra_params_.release()); args.Append(extra_params_.release());
Emit("did-attach", args); Emit("did-attach", args);
} }
int WebContents::GetGuestInstanceID() const {
return guest_instance_id_;
}
void WebContents::ElementSizeChanged(const gfx::Size& old_size, void WebContents::ElementSizeChanged(const gfx::Size& old_size,
const gfx::Size& new_size) { const gfx::Size& new_size) {
element_size_ = new_size; element_size_ = new_size;
@ -260,18 +244,16 @@ void WebContents::GuestSizeChanged(const gfx::Size& old_size,
GuestSizeChangedDueToAutoSize(old_size, new_size); GuestSizeChangedDueToAutoSize(old_size, new_size);
} }
void WebContents::RequestPointerLockPermission(
bool user_gesture,
bool last_unlocked_by_target,
const base::Callback<void(bool enabled)>& callback) {
callback.Run(true);
}
void WebContents::RegisterDestructionCallback( void WebContents::RegisterDestructionCallback(
const DestructionCallback& callback) { const DestructionCallback& callback) {
destruction_callback_ = callback; destruction_callback_ = callback;
} }
void WebContents::WillAttach(content::WebContents* embedder_web_contents,
int browser_plugin_instance_id) {
embedder_web_contents_ = embedder_web_contents;
}
void WebContents::Destroy() { void WebContents::Destroy() {
if (storage_) { if (storage_) {
if (!destruction_callback_.is_null()) if (!destruction_callback_.is_null())
@ -294,7 +276,7 @@ void WebContents::LoadURL(const GURL& url, const mate::Dictionary& options) {
params.referrer = content::Referrer(http_referrer.GetAsReferrer(), params.referrer = content::Referrer(http_referrer.GetAsReferrer(),
blink::WebReferrerPolicyDefault); blink::WebReferrerPolicyDefault);
params.transition_type = content::PAGE_TRANSITION_TYPED; params.transition_type = ui::PAGE_TRANSITION_TYPED;
params.override_user_agent = content::NavigationController::UA_OVERRIDE_TRUE; params.override_user_agent = content::NavigationController::UA_OVERRIDE_TRUE;
web_contents()->GetController().LoadURLWithParams(params); web_contents()->GetController().LoadURLWithParams(params);
} }

View file

@ -138,22 +138,14 @@ class WebContents : public mate::EventEmitter,
virtual void WebContentsDestroyed() override; virtual void WebContentsDestroyed() override;
// content::BrowserPluginGuestDelegate: // content::BrowserPluginGuestDelegate:
virtual void WillAttach(content::WebContents* embedder_web_contents, void DidAttach(int guest_proxy_routing_id) final;
const base::DictionaryValue& extra_params) override; void ElementSizeChanged(const gfx::Size& old_size,
virtual content::WebContents* CreateNewGuestWindow( const gfx::Size& new_size) final;
const content::WebContents::CreateParams& create_params) override; void GuestSizeChanged(const gfx::Size& old_size,
virtual void DidAttach() override; const gfx::Size& new_size) final;
virtual int GetGuestInstanceID() const override; void RegisterDestructionCallback(const DestructionCallback& callback) final;
virtual void ElementSizeChanged(const gfx::Size& old_size, void WillAttach(content::WebContents* embedder_web_contents,
const gfx::Size& new_size) override; int browser_plugin_instance_id) final;
virtual void GuestSizeChanged(const gfx::Size& old_size,
const gfx::Size& new_size) override;
virtual void RequestPointerLockPermission(
bool user_gesture,
bool last_unlocked_by_target,
const base::Callback<void(bool enabled)>& callback) override;
virtual void RegisterDestructionCallback(
const DestructionCallback& callback) override;
private: private:
// Called when received a message from renderer. // Called when received a message from renderer.

View file

@ -7,8 +7,7 @@
namespace atom { namespace atom {
JavascriptEnvironment::JavascriptEnvironment() JavascriptEnvironment::JavascriptEnvironment()
: isolate_holder_(gin::IsolateHolder::kNonStrictMode), : isolate_(isolate_holder_.isolate()),
isolate_(isolate_holder_.isolate()),
isolate_scope_(isolate_), isolate_scope_(isolate_),
locker_(isolate_), locker_(isolate_),
handle_scope_(isolate_), handle_scope_(isolate_),

View file

@ -22,7 +22,7 @@ AdapterRequestJob::AdapterRequestJob(ProtocolHandler* protocol_handler,
} }
void AdapterRequestJob::Start() { void AdapterRequestJob::Start() {
DCHECK(!real_job_); DCHECK(!real_job_.get());
content::BrowserThread::PostTask( content::BrowserThread::PostTask(
content::BrowserThread::UI, content::BrowserThread::UI,
FROM_HERE, FROM_HERE,
@ -31,35 +31,35 @@ void AdapterRequestJob::Start() {
} }
void AdapterRequestJob::Kill() { void AdapterRequestJob::Kill() {
if (real_job_) // Kill could happen when real_job_ is created. if (real_job_.get()) // Kill could happen when real_job_ is created.
real_job_->Kill(); real_job_->Kill();
} }
bool AdapterRequestJob::ReadRawData(net::IOBuffer* buf, bool AdapterRequestJob::ReadRawData(net::IOBuffer* buf,
int buf_size, int buf_size,
int *bytes_read) { int *bytes_read) {
DCHECK(real_job_); DCHECK(!real_job_.get());
return real_job_->ReadRawData(buf, buf_size, bytes_read); return real_job_->ReadRawData(buf, buf_size, bytes_read);
} }
bool AdapterRequestJob::IsRedirectResponse(GURL* location, bool AdapterRequestJob::IsRedirectResponse(GURL* location,
int* http_status_code) { int* http_status_code) {
DCHECK(real_job_); DCHECK(!real_job_.get());
return real_job_->IsRedirectResponse(location, http_status_code); return real_job_->IsRedirectResponse(location, http_status_code);
} }
net::Filter* AdapterRequestJob::SetupFilter() const { net::Filter* AdapterRequestJob::SetupFilter() const {
DCHECK(real_job_); DCHECK(!real_job_.get());
return real_job_->SetupFilter(); return real_job_->SetupFilter();
} }
bool AdapterRequestJob::GetMimeType(std::string* mime_type) const { bool AdapterRequestJob::GetMimeType(std::string* mime_type) const {
DCHECK(real_job_); DCHECK(!real_job_.get());
return real_job_->GetMimeType(mime_type); return real_job_->GetMimeType(mime_type);
} }
bool AdapterRequestJob::GetCharset(std::string* charset) { bool AdapterRequestJob::GetCharset(std::string* charset) {
DCHECK(real_job_); DCHECK(!real_job_.get());
return real_job_->GetCharset(charset); return real_job_->GetCharset(charset);
} }

View file

@ -75,14 +75,13 @@ void WebViewManager::RemoveGuest(int guest_instance_id) {
web_contents_map_.erase(guest_instance_id); web_contents_map_.erase(guest_instance_id);
} }
void WebViewManager::MaybeGetGuestByInstanceIDOrKill( content::WebContents* WebViewManager::GetGuestByInstanceID(
int guest_instance_id, content::WebContents* embedder_web_contents,
int embedder_render_process_id, int guest_instance_id) {
const GuestByInstanceIDCallback& callback) {
if (ContainsKey(web_contents_map_, guest_instance_id)) if (ContainsKey(web_contents_map_, guest_instance_id))
callback.Run(web_contents_map_[guest_instance_id].web_contents); return web_contents_map_[guest_instance_id].web_contents;
else else
callback.Run(nullptr); return nullptr;
} }
bool WebViewManager::ForEachGuest(content::WebContents* embedder_web_contents, bool WebViewManager::ForEachGuest(content::WebContents* embedder_web_contents,

View file

@ -8,6 +8,7 @@
#include <map> #include <map>
#include "content/public/browser/browser_plugin_guest_manager.h" #include "content/public/browser/browser_plugin_guest_manager.h"
#include "url/gurl.h"
namespace content { namespace content {
class BrowserContext; class BrowserContext;
@ -30,12 +31,11 @@ class WebViewManager : public content::BrowserPluginGuestManager {
protected: protected:
// content::BrowserPluginGuestManager: // content::BrowserPluginGuestManager:
virtual void MaybeGetGuestByInstanceIDOrKill( content::WebContents* GetGuestByInstanceID(
int guest_instance_id, content::WebContents* embedder_web_contents,
int embedder_render_process_id, int browser_plugin_instance_id) override;
const GuestByInstanceIDCallback& callback) override; bool ForEachGuest(content::WebContents* embedder_web_contents,
virtual bool ForEachGuest(content::WebContents* embedder_web_contents, const GuestCallback& callback) override;
const GuestCallback& callback) override;
private: private:
struct WebContentsWithEmbedder { struct WebContentsWithEmbedder {

View file

@ -58,8 +58,7 @@ base::string16 ReadText(ui::ClipboardType type) {
} }
void WriteText(const base::string16& text, ui::ClipboardType type) { void WriteText(const base::string16& text, ui::ClipboardType type) {
ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread(); ui::ScopedClipboardWriter writer(type);
ui::ScopedClipboardWriter writer(clipboard, type);
writer.WriteText(text); writer.WriteText(text);
} }