| 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 "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
| 9 #include "base/synchronization/lock.h" | 9 #include "base/synchronization/lock.h" |
| 10 #include "content/public/browser/notification_source.h" | 10 #include "content/public/browser/notification_source.h" |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 | 472 |
| 473 void UIThreadExtensionFunction::SetTransferredBlobUUIDs( | 473 void UIThreadExtensionFunction::SetTransferredBlobUUIDs( |
| 474 const std::vector<std::string>& blob_uuids) { | 474 const std::vector<std::string>& blob_uuids) { |
| 475 DCHECK(transferred_blob_uuids_.empty()); // Should only be called once. | 475 DCHECK(transferred_blob_uuids_.empty()); // Should only be called once. |
| 476 transferred_blob_uuids_ = blob_uuids; | 476 transferred_blob_uuids_ = blob_uuids; |
| 477 } | 477 } |
| 478 | 478 |
| 479 void UIThreadExtensionFunction::WriteToConsole( | 479 void UIThreadExtensionFunction::WriteToConsole( |
| 480 content::ConsoleMessageLevel level, | 480 content::ConsoleMessageLevel level, |
| 481 const std::string& message) { | 481 const std::string& message) { |
| 482 render_frame_host_->Send(new ExtensionMsg_AddMessageToConsole( | 482 // Only the main frame handles dev tools messages. |
| 483 render_frame_host_->GetRoutingID(), level, message)); | 483 WebContents::FromRenderFrameHost(render_frame_host_) |
| 484 ->GetMainFrame() |
| 485 ->AddMessageToConsole(level, message); |
| 484 } | 486 } |
| 485 | 487 |
| 486 IOThreadExtensionFunction::IOThreadExtensionFunction() | 488 IOThreadExtensionFunction::IOThreadExtensionFunction() |
| 487 : routing_id_(MSG_ROUTING_NONE) { | 489 : routing_id_(MSG_ROUTING_NONE) { |
| 488 } | 490 } |
| 489 | 491 |
| 490 IOThreadExtensionFunction::~IOThreadExtensionFunction() { | 492 IOThreadExtensionFunction::~IOThreadExtensionFunction() { |
| 491 } | 493 } |
| 492 | 494 |
| 493 IOThreadExtensionFunction* | 495 IOThreadExtensionFunction* |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 | 552 |
| 551 ExtensionFunction::ResponseAction SyncIOThreadExtensionFunction::Run() { | 553 ExtensionFunction::ResponseAction SyncIOThreadExtensionFunction::Run() { |
| 552 return RespondNow(RunSync() ? ArgumentList(results_.Pass()) : Error(error_)); | 554 return RespondNow(RunSync() ? ArgumentList(results_.Pass()) : Error(error_)); |
| 553 } | 555 } |
| 554 | 556 |
| 555 // static | 557 // static |
| 556 bool SyncIOThreadExtensionFunction::ValidationFailure( | 558 bool SyncIOThreadExtensionFunction::ValidationFailure( |
| 557 SyncIOThreadExtensionFunction* function) { | 559 SyncIOThreadExtensionFunction* function) { |
| 558 return false; | 560 return false; |
| 559 } | 561 } |
| OLD | NEW |