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

Side by Side Diff: extensions/renderer/renderer_user_script.h

Issue 2227193002: Make UserScript non-copyable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: uplaod with base Created 4 years, 4 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 EXTENSIONS_RENDERER_RENDERER_USER_SCRIPT_H_
6 #define EXTENSIONS_RENDERER_RENDERER_USER_SCRIPT_H_
7
8 #include "extensions/common/user_script.h"
9
10 namespace extensions {
11
12 // renderer/ process representation of a user script file.
13 // The content it points to is owned by some shared memory.
14 class RendererScriptFile : public UserScriptFileInfo {
15 public:
16 RendererScriptFile();
17 RendererScriptFile(const UserScriptFileInfo& info);
18 ~RendererScriptFile() override;
19
20 void set_external_content(base::StringPiece content) { content_ = content; }
21 base::StringPiece GetContent() { return content_; }
22
23 private:
24 base::StringPiece content_;
25
26 DISALLOW_COPY_AND_ASSIGN(RendererScriptFile);
27 };
28
29 // renderer/ process representation of a user script.
30 // A user script can contain multiple script files in it. The renderer/ process
31 // gets the contents of these files via shared memory.
32 class RendererUserScript : public UserScriptInfo,
33 public UserScriptFiles<RendererScriptFile> {
34 public:
35 RendererUserScript();
36 RendererUserScript(const UserScriptInfo& meta,
37 const UserScriptFiles<UserScriptFileInfo>& files);
38 ~RendererUserScript() override;
39
40 void Unpickle(const base::Pickle& pickle, base::PickleIterator* iter);
41
42 private:
43 DISALLOW_COPY_AND_ASSIGN(RendererUserScript);
44 };
45
46 } // namespace extensions
47
48 #endif // EXTENSIONS_RENDERER_RENDERER_USER_SCRIPT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698