Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(443)

Side by Side Diff: extensions/browser/extension_function.h

Issue 2166523003: Add ref count to service workers for extension API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_ 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_
6 #define EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_ 6 #define EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <list> 10 #include <list>
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 extensions::ExtensionFunctionDispatcher>& dispatcher) { 524 extensions::ExtensionFunctionDispatcher>& dispatcher) {
525 dispatcher_ = dispatcher; 525 dispatcher_ = dispatcher;
526 } 526 }
527 extensions::ExtensionFunctionDispatcher* dispatcher() const { 527 extensions::ExtensionFunctionDispatcher* dispatcher() const {
528 return dispatcher_.get(); 528 return dispatcher_.get();
529 } 529 }
530 530
531 void set_is_from_service_worker(bool value) { 531 void set_is_from_service_worker(bool value) {
532 is_from_service_worker_ = value; 532 is_from_service_worker_ = value;
533 } 533 }
534 void set_embedded_worker_id(int embedded_worker_id) {
535 embedded_worker_id_ = embedded_worker_id;
536 }
534 537
535 // Gets the "current" web contents if any. If there is no associated web 538 // Gets the "current" web contents if any. If there is no associated web
536 // contents then defaults to the foremost one. 539 // contents then defaults to the foremost one.
537 // NOTE: "current" can mean different things in different contexts. You 540 // NOTE: "current" can mean different things in different contexts. You
538 // probably want to use GetSenderWebContents(). 541 // probably want to use GetSenderWebContents().
539 virtual content::WebContents* GetAssociatedWebContents(); 542 virtual content::WebContents* GetAssociatedWebContents();
540 543
541 // Returns the web contents associated with the sending |render_frame_host_|. 544 // Returns the web contents associated with the sending |render_frame_host_|.
542 // This can be null. 545 // This can be null.
543 content::WebContents* GetSenderWebContents(); 546 content::WebContents* GetSenderWebContents();
(...skipping 25 matching lines...) Expand all
569 572
570 // The dispatcher that will service this extension function call. 573 // The dispatcher that will service this extension function call.
571 base::WeakPtr<extensions::ExtensionFunctionDispatcher> dispatcher_; 574 base::WeakPtr<extensions::ExtensionFunctionDispatcher> dispatcher_;
572 575
573 // The RenderFrameHost we will send responses to. 576 // The RenderFrameHost we will send responses to.
574 content::RenderFrameHost* render_frame_host_; 577 content::RenderFrameHost* render_frame_host_;
575 578
576 // Whether or not this ExtensionFunction was called by an extension Service 579 // Whether or not this ExtensionFunction was called by an extension Service
577 // Worker. 580 // Worker.
578 bool is_from_service_worker_; 581 bool is_from_service_worker_;
582 int embedded_worker_id_;
579 583
580 std::unique_ptr<RenderFrameHostTracker> tracker_; 584 std::unique_ptr<RenderFrameHostTracker> tracker_;
581 585
582 DelegateForTests* delegate_; 586 DelegateForTests* delegate_;
583 587
584 // The blobs transferred to the renderer process. 588 // The blobs transferred to the renderer process.
585 std::vector<std::string> transferred_blob_uuids_; 589 std::vector<std::string> transferred_blob_uuids_;
586 590
587 DISALLOW_COPY_AND_ASSIGN(UIThreadExtensionFunction); 591 DISALLOW_COPY_AND_ASSIGN(UIThreadExtensionFunction);
588 }; 592 };
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 private: 724 private:
721 // If you're hitting a compile error here due to "final" - great! You're 725 // If you're hitting a compile error here due to "final" - great! You're
722 // doing the right thing, you just need to extend IOThreadExtensionFunction 726 // doing the right thing, you just need to extend IOThreadExtensionFunction
723 // instead of SyncIOExtensionFunction. 727 // instead of SyncIOExtensionFunction.
724 ResponseAction Run() final; 728 ResponseAction Run() final;
725 729
726 DISALLOW_COPY_AND_ASSIGN(SyncIOThreadExtensionFunction); 730 DISALLOW_COPY_AND_ASSIGN(SyncIOThreadExtensionFunction);
727 }; 731 };
728 732
729 #endif // EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_ 733 #endif // EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698