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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: extensions/renderer/renderer_user_script.h
diff --git a/extensions/renderer/renderer_user_script.h b/extensions/renderer/renderer_user_script.h
new file mode 100644
index 0000000000000000000000000000000000000000..4ddb56555c3eff834d03c9f689f007f62f9ab7fd
--- /dev/null
+++ b/extensions/renderer/renderer_user_script.h
@@ -0,0 +1,48 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef EXTENSIONS_RENDERER_RENDERER_USER_SCRIPT_H_
+#define EXTENSIONS_RENDERER_RENDERER_USER_SCRIPT_H_
+
+#include "extensions/common/user_script.h"
+
+namespace extensions {
+
+// renderer/ process representation of a user script file.
+// The content it points to is owned by some shared memory.
+class RendererScriptFile : public UserScriptFileInfo {
+ public:
+ RendererScriptFile();
+ RendererScriptFile(const UserScriptFileInfo& info);
+ ~RendererScriptFile() override;
+
+ void set_external_content(base::StringPiece content) { content_ = content; }
+ base::StringPiece GetContent() { return content_; }
+
+ private:
+ base::StringPiece content_;
+
+ DISALLOW_COPY_AND_ASSIGN(RendererScriptFile);
+};
+
+// renderer/ process representation of a user script.
+// A user script can contain multiple script files in it. The renderer/ process
+// gets the contents of these files via shared memory.
+class RendererUserScript : public UserScriptInfo,
+ public UserScriptFiles<RendererScriptFile> {
+ public:
+ RendererUserScript();
+ RendererUserScript(const UserScriptInfo& meta,
+ const UserScriptFiles<UserScriptFileInfo>& files);
+ ~RendererUserScript() override;
+
+ void Unpickle(const base::Pickle& pickle, base::PickleIterator* iter);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RendererUserScript);
+};
+
+} // namespace extensions
+
+#endif // EXTENSIONS_RENDERER_RENDERER_USER_SCRIPT_H_

Powered by Google App Engine
This is Rietveld 408576698