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

Side by Side Diff: chrome/browser/renderer_host/chrome_navigation_ui_data.h

Issue 2335133003: PlzNavigate: support the WebRequest API (Closed)
Patch Set: Rebase + addressed nit Created 4 years, 2 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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_RENDERER_HOST_CHROME_NAVIGATION_UI_DATA_H_
6 #define CHROME_BROWSER_RENDERER_HOST_CHROME_NAVIGATION_UI_DATA_H_
7
8 #include <memory>
9
10 #include "base/macros.h"
11 #include "content/public/browser/navigation_ui_data.h"
12 #include "extensions/browser/extension_navigation_ui_data.h"
13
14 namespace content {
15 class NavigationHandle;
16 }
17
18 // PlzNavigate
19 // Contains data that is passed from the UI thread to the IO thread at the
20 // beginning of each navigation. The class is instantiated on the UI thread,
21 // then a copy created using Clone is passed to the content::ResourceRequestInfo
22 // on the IO thread.
23 class ChromeNavigationUIData : public content::NavigationUIData {
24 public:
25 ChromeNavigationUIData();
26 explicit ChromeNavigationUIData(content::NavigationHandle* navigation_handle);
27 ~ChromeNavigationUIData() override;
28
29 // Creates a new ChromeNavigationUIData that is a deep copy of the original.
30 // Any changes to the original after the clone is created will not be
31 // reflected in the clone. |extension_data_| is deep copied.
32 std::unique_ptr<content::NavigationUIData> Clone() const override;
33
34 #if defined(ENABLE_EXTENSIONS)
35 void SetExtensionNavigationUIData(
36 std::unique_ptr<extensions::ExtensionNavigationUIData> extension_data);
37
38 extensions::ExtensionNavigationUIData* GetExtensionNavigationUIData() const {
39 return extension_data_.get();
40 }
41 #endif
42
43 private:
44 #if defined(ENABLE_EXTENSIONS)
45 // Manages the lifetime of optional ExtensionNavigationUIData information.
46 std::unique_ptr<extensions::ExtensionNavigationUIData> extension_data_;
47 #endif
48
49 DISALLOW_COPY_AND_ASSIGN(ChromeNavigationUIData);
50 };
51
52 #endif // CHROME_BROWSER_RENDERER_HOST_CHROME_NAVIGATION_UI_DATA_H_
OLDNEW
« no previous file with comments | « chrome/browser/net/chrome_extensions_network_delegate.cc ('k') | chrome/browser/renderer_host/chrome_navigation_ui_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698