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

Unified Diff: runtime/embedders/openglui/emulator/emulator_resource.h

Issue 25081002: Remove openglui embedder code (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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: runtime/embedders/openglui/emulator/emulator_resource.h
diff --git a/runtime/embedders/openglui/emulator/emulator_resource.h b/runtime/embedders/openglui/emulator/emulator_resource.h
deleted file mode 100644
index fc54f8ac8ba5c0c7fb3909da1cabdf449a323125..0000000000000000000000000000000000000000
--- a/runtime/embedders/openglui/emulator/emulator_resource.h
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-#ifndef EMBEDDERS_OPENGLUI_EMULATOR_EMULATOR_RESOURCE_H_
-#define EMBEDDERS_OPENGLUI_EMULATOR_EMULATOR_RESOURCE_H_
-
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include "embedders/openglui/common/log.h"
-#include "embedders/openglui/common/resource.h"
-
-class EmulatorResource : public Resource {
- public:
- explicit EmulatorResource(const char* path)
- : Resource(path),
- fd_(-1) {
- }
-
- int32_t descriptor() {
- if (fd_ < 0) {
- Open();
- }
- return fd_;
- }
-
- off_t length() {
- if (length_ < 0) {
- length_ = lseek(fd_, 0, SEEK_END);
- lseek(fd_, 0, SEEK_SET);
- }
- return length_;
- }
-
- int32_t Open() {
- fd_ = open(path_, 0);
- if (fd_ >= 0) {
- return 0;
- }
- LOGE("Could not open asset %s", path_);
- return -1;
- }
-
- void Close() {
- if (fd_ >= 0) {
- close(fd_);
- fd_ = -1;
- }
- }
-
- int32_t Read(void* buffer, size_t count) {
- size_t actual = read(fd_, buffer, count);
- return (actual == count) ? 0 : -1;
- }
-
- private:
- int fd_;
-};
-
-#endif // EMBEDDERS_OPENGLUI_EMULATOR_EMULATOR_RESOURCE_H_
-
« no previous file with comments | « runtime/embedders/openglui/emulator/emulator_graphics_handler.cc ('k') | runtime/embedders/openglui/openglui_embedder.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698