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

Side by Side Diff: content/child/npapi/plugin_string_stream.cc

Issue 1426923007: Remove PluginLoadObserver and related logic, it was only used for NPAPI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « content/child/npapi/plugin_string_stream.h ('k') | content/child/npapi/plugin_url_fetcher.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 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 #include "content/child/npapi/plugin_string_stream.h"
6
7 #include "url/gurl.h"
8
9 namespace content {
10
11 PluginStringStream::PluginStringStream(
12 PluginInstance* instance,
13 const GURL& url,
14 bool notify_needed,
15 void* notify_data)
16 : PluginStream(instance, url.spec().c_str(), notify_needed, notify_data) {
17 }
18
19 PluginStringStream::~PluginStringStream() {
20 }
21
22 void PluginStringStream::SendToPlugin(const std::string &data,
23 const std::string &mime_type) {
24 // Protect the stream against it being destroyed or the whole plugin instance
25 // being destroyed within the plugin stream callbacks.
26 scoped_refptr<PluginStringStream> protect(this);
27
28 int length = static_cast<int>(data.length());
29 if (Open(mime_type, std::string(), length, 0, false)) {
30 // TODO - check if it was not fully sent, and figure out a backup plan.
31 int written = Write(data.c_str(), length, 0);
32 NPReason reason = written == length ? NPRES_DONE : NPRES_NETWORK_ERR;
33 Close(reason);
34 }
35 }
36
37 } // namespace content
OLDNEW
« no previous file with comments | « content/child/npapi/plugin_string_stream.h ('k') | content/child/npapi/plugin_url_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698