OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "extensions/browser/extension_function.h" | 5 #include "extensions/browser/extension_function.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "content/public/browser/notification_source.h" | 8 #include "content/public/browser/notification_source.h" |
9 #include "content/public/browser/notification_types.h" | 9 #include "content/public/browser/notification_types.h" |
10 #include "content/public/browser/render_frame_host.h" | 10 #include "content/public/browser/render_frame_host.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 function_->SetRenderViewHost(NULL); | 123 function_->SetRenderViewHost(NULL); |
124 } | 124 } |
125 virtual void RenderFrameDeleted( | 125 virtual void RenderFrameDeleted( |
126 content::RenderFrameHost* render_frame_host) OVERRIDE { | 126 content::RenderFrameHost* render_frame_host) OVERRIDE { |
127 if (render_frame_host != function_->render_frame_host()) | 127 if (render_frame_host != function_->render_frame_host()) |
128 return; | 128 return; |
129 | 129 |
130 function_->SetRenderFrameHost(NULL); | 130 function_->SetRenderFrameHost(NULL); |
131 } | 131 } |
132 | 132 |
| 133 virtual bool OnMessageReceived( |
| 134 const IPC::Message& message, |
| 135 content::RenderFrameHost* render_frame_host) OVERRIDE { |
| 136 DCHECK(render_frame_host); |
| 137 if (render_frame_host == function_->render_frame_host()) |
| 138 return function_->OnMessageReceived(message); |
| 139 else |
| 140 return false; |
| 141 } |
| 142 |
133 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE { | 143 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE { |
134 return function_->OnMessageReceived(message); | 144 return function_->OnMessageReceived(message); |
135 } | 145 } |
136 | 146 |
137 UIThreadExtensionFunction* function_; | 147 UIThreadExtensionFunction* function_; |
138 | 148 |
139 DISALLOW_COPY_AND_ASSIGN(RenderHostTracker); | 149 DISALLOW_COPY_AND_ASSIGN(RenderHostTracker); |
140 }; | 150 }; |
141 | 151 |
142 ExtensionFunction::ExtensionFunction() | 152 ExtensionFunction::ExtensionFunction() |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 SyncIOThreadExtensionFunction::SyncIOThreadExtensionFunction() { | 388 SyncIOThreadExtensionFunction::SyncIOThreadExtensionFunction() { |
379 } | 389 } |
380 | 390 |
381 SyncIOThreadExtensionFunction::~SyncIOThreadExtensionFunction() { | 391 SyncIOThreadExtensionFunction::~SyncIOThreadExtensionFunction() { |
382 } | 392 } |
383 | 393 |
384 ExtensionFunction::ResponseAction SyncIOThreadExtensionFunction::Run() { | 394 ExtensionFunction::ResponseAction SyncIOThreadExtensionFunction::Run() { |
385 return RespondNow(RunSync() ? MultipleArguments(results_.get()) | 395 return RespondNow(RunSync() ? MultipleArguments(results_.get()) |
386 : Error(error_)); | 396 : Error(error_)); |
387 } | 397 } |
OLD | NEW |